package com.cskaoyan.user.converter;

import com.cskaoyan.user.dal.entitys.Member;
import com.cskaoyan.user.dto.UserLoginResponse;
import com.cskaoyan.user.dto.UserLoginResult;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

@Mapper(componentModel = "spring")
public interface UserConverterMapper {

    @Mappings({
            @Mapping(target = "token", constant = "")
    })
    UserLoginResponse member2LoginResp(Member member);

    @Mappings({
            @Mapping(target = "code", constant = "000000"),
            @Mapping(target = "msg", constant = "成功")
    })
    UserLoginResult loginResp2Result(UserLoginResponse loginResponse);
}
